package com.york.subject.domain.convert;

import com.york.subject.domain.entity.SubjectInfoBO;
import com.york.subject.domain.entity.SubjectOptionBO;
import com.york.subject.infra.basic.entity.SubjectInfo;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 拦截器，实现转换器功能，因为我们需要的是SubjectInfoConverter对象，而该模块使用SubjectInfoBO
 */
@Mapper
public interface SubjectInfoConverter {

    // 返回实现接口的实例
    SubjectInfoConverter INSTANCE = Mappers.getMapper(SubjectInfoConverter.class);

    SubjectInfo convertBoToInfo(SubjectInfoBO subjectInfoBO);

    List<SubjectInfoBO> convertListInfoToBO(List<SubjectInfo> subjectInfoList);

    SubjectInfoBO convertOptionAndInfoToBO(SubjectOptionBO optionBO, SubjectInfo subjectInfo);
}
